/**
 * COPYRIGHT. Harry Wu 2011. ALL RIGHTS RESERVED.
 * Project: WakeRemote4J
 * Author: Harry Wu <harrywu304@gmail.com>
 *
*/ 
package org.shaitu.wakeremote4j;

import org.shaitu.wakeremote4j.util.PacketUtil;

/**
 * cmd support
 * 
 * @author whx
 */
public class WakeRemote {

    public static void main(String[] args) {
    	HostBean host = new HostBean();
    	String mac ="";
    	String ip ="";
    	int port=AppContext.PORT;
    	switch(args.length){
    		case 0: 
    			System.out.println("Usage: WakeRemote mac [ip] [port]" );
    			System.out.println("	mac seperated with '-' or ':' " );
    			return;
    		case 1:
    			host.setMac(args[0]);
    			break;
    		case 2:
    			host.setMac(args[0]);
    			host.setIp(args[1]);
        		break;
    		case 3:
    			host.setMac(args[0]);
    			host.setIp(args[1]);
        		host.setPort(Integer.parseInt(args[2]));
        		break;        		
    	}
    	PacketUtil.sendWakeUpMessage(host);
        System.out.println("send power up packet successful :`)");
    }
}
